package org.example.exp3.exam5;

import java.util.*;

public abstract class Editor {

   private ArrayList<StatisticObserver> observerList = new ArrayList<>();
   
   public void attach(StatisticObserver observer) {
      observerList.add(observer);
   }
   

   public void detach(StatisticObserver observer) {
      observerList.remove(observer);
   }
   
   public void notifyObservers(){
      for (StatisticObserver statisticObserver : observerList) {
         statisticObserver.update();
      }
   }
}